package com.jinxi.web.service;

import com.jfinal.plugin.activerecord.Page;
import com.jinxi.web.dao.BaseDao;
import com.jinxi.web.entitiy.Area;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by changqi.wu on 2017/10/30.
 */

@Service
public class AreaService {

    @Autowired
    private BaseDao baseDao;

    @Transactional
    public Long save(Area area) {
        return (Long) baseDao.save(area);
    }

    public Page<Area> getAreaList(Integer pag, Integer limit) {
        String hql = "FROM Area ";
        return baseDao.queryForPageByHql(hql, pag, limit);
    }

}
